finding the mean average from frequency table